﻿@model BrnMall.Web.StoreAdmin.Models.CashOrderListModel

@section header{
    <title>充值记录-店铺管理</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/showlist.js"></script>
}
@section body{
    <h1 class="rightH1">
        微信小程序 &gt; 店铺管理 &gt; <span class="rightH1-cur">充值记录</span> 
        <div class="right">
        </div>
        <div class="clear"></div>
    </h1>
@using (Html.BeginForm("list", "cashorder"))
{
<div class="dataListSearch">
    <table height="32">
        <tbody class="col3">
            <tr>
                <td class="td1">订单编号：@Html.TextBox("OSN", Model.OSN, new { height = "18" })</td>
                <td class="td2">会员昵称：@Html.TextBox("AccountName", Model.AccountName, new { height = "18" })</td>
                <td class="td3">订单状态：@Html.DropDownListFor(x => x.OrderState, Model.OrderStateList)</td>
                <td><input id="SearchOrder" name="SearchOrder" type="image" class="searchBut submit" src="/admin_store/images/s.jpg" /></td>
            </tr>
        </tbody>
    </table>
</div>

    <div class="table_top"></div>

    <div class="dataList">
        <table width="100%">
            <thead>
                <tr>
                    <th width="200">会员昵称</th>
                    <th align="left">订单号</th>
                    <th align="left">充值金额</th>
                    <th align="left">赠送金额</th>
                    <th width="80" align="left">状态</th>
                    <th align="left">创建时间</th>          
                </tr>
            </thead>
            <tbody>
                @foreach (var info in Model.List)
                {
                    <tr>
                        <td>@info.AccountName</td>
                        <td>@info.OSN</td>
                        <td>@info.OrderAmount</td>
                        <td>@info.GiveAmount</td>
                        <td class="orderState" data-state="@info.OrderState"> </td>
                        <td>@info.CreateTime.ToString("yyyy-MM-dd hh:mm:ss")</td>                       
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <input type="hidden" id="uid" name="uid" value="0"/>
<div class="dataListEdit">
    <div class="page">
        @Html.StoreAdminPager(Model.PageModel)
    </div>
</div>
    <script>
        $(function () {
            load();
        })
        function load() {
            $(".orderState").each(function () {
                var state = $(this).attr("data-state");
                if (state == 20)
                    $(this).html("等待付款")
                else if (state == 40)
                    $(this).html("待确认")
                else if (state == 60)
                    $(this).html("已付款")
                else
                    $(this).html("未知")
            })
        }

    </script>
}
}